<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>登录</title>

    <!-- CSS -->
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500">
    <link href="../assets/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css"" rel="stylesheet">
    <link rel="stylesheet" href="./css/login-form-elements.css">
    <link rel="stylesheet" href="./css/login.css">
    <link rel="stylesheet" href="../css/layer/mobile/need/layer.css">

    <!-- Favicon and touch icons -->
    <!--<link rel="shortcut icon" href="./assets/ico/favicon.png">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="./assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="./assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="./assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="./assets/ico/apple-touch-icon-57-precomposed.png">-->
    <style>
        .top-content .inner-bg {
            background-color: rgba(0, 0, 0, 0.4);
        }
    </style>
</head>

<body>

    <!-- Top content -->
    <div class="top-content">

        <div class="inner-bg">
            <div class="container">
                <div class="row">
                    <div class="col-sm-8 col-sm-offset-2 text">
                        <h1><strong>冷链溯源系统</strong> 登录</h1>
                        <div class="description">
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-6 col-sm-offset-3 form-box">
                        <div class="form-top">
                            <div class="form-top-left">
                                <h3>监管人员登录<strong> Login to our site</strong></h3>
                                <p>请输入你的用户名和密码 :)</p>
                            </div>
                            <div class="form-top-right">
                                <i class="fa fa-key"></i>
                            </div>
                        </div>
                        <div class="form-bottom">
                            <form role="form" class="login-form">
                                <div class="form-group">
                                    <label class="sr-only" for="form-username">用户名：</label>
                                    <input type="text" name="supersivorNum" placeholder="请输入用户名..." class="form-username form-control" id="form-username">
                                </div>
                                <div class="form-group">
                                    <label class="sr-only" for="form-password">密码：</label>
                                    <input type="password" name="supersivorPwd" placeholder="请输入密码..." class="form-password form-control" id="form-password">
                                </div>
                                <button type="button" id="submit" class="btn">登录 Login it!</button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- Javascript -->
    <script src="../plugs/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="../css/layer/layer.js"></script>
    <script src="../assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery-backstretch/2.0.4/jquery.backstretch.min.js"></script>
    <script src="./js/login.js"></script>
</body>
<script>
$(document).ready(function(){
	$('#submit').click(function(){
		var supersivorNum = $('#form-username').val();
		var supersivorPwd = $('#form-password').val();
        var layer1 = layer.msg('正在处理登录信息...', {
            icon: 16
            ,shade: 0.5,
            time:0,
        });
		$.ajax({
			type: "post",
			url: "login.do",
			data:{
				"supersivorNum":supersivorNum,
				"supersivorPwd":supersivorPwd
			},
			success:function(data,status)
			{
				switch (data)
				{
					case "0":
					    layer.close(layer1);
                        layer.msg('登录成功，即将为您跳转到系统页面!', {icon: 6});
					    setTimeout(function (){
                            window.location="supersivor.jsp";
                        },1000)
						break;
					case "2":
						// alert("账号或者密码错误");
						layer.msg("账号或者密码错误",{icon: 5})
				}
			},
			error:function(status)
			{
				// alert("server error！");
				layer.msg("服务器内部错误",{icon: 5})
			}
		})
		
		
	});
	
});
</script>
</html>